package com.lj.api.tools;

import com.lj.api.tools.Qniu.QNiuTools;
import com.lj.mcore.entity.Accessory;

public class AccessoryTools {


    public static final String USER_IMAGE_SETTING="?imageView2/1/w/300/h/300/format/jpg/interlace/1/q/60";
    public static final String PNG_IMAGE_SETTING="?imageView2/1/w/300/h/300/format/png/interlace/1/q/60";
    public static final String COMMENT_lIST_IMAGE_SETTING="?imageView2/1/w/300/h/300/format/jpg/interlace/1/q/60";
    public static final String COMMENT_DETAIL_IMAGE_SETTING="?imageView2/2/w/1280/h/1280/format/jpg/interlace/0/q/60";
    public static final String GOODS_DETAIL_IMAGE_SETTING="?imageView2/2/w/1080/h/1080/format/jpg/interlace/0/q/60";
    public static final String GOODS_IMAGE_SETTING="?imageView2/2/w/300/h/300/format/jpg/interlace/0/q/60";
    public static final String COMMENT_NUTRIELE_IMAGE_SETTING="?imageView2/0/h/1080/format/png/interlace/0/60";
    public static final String IMAGE_DETALL = "?imageView2/2/w/1280/format/jpg/interlace/0/q/60";

    public static String getURL(Accessory accessory){
        return accessory.getInfo()+accessory.getPath()+ accessory.getName();
    }


    /**
     * @param site
     *
     * 1 USER_IMAGE_SETTING :用于头像
     * 2 GOODS_DETAIL_IMAGE_SETTING ：商品展示 1080*1080
     * 3 GOODS_IMAGE_SETTING ：商品缩略图， 300*300
     * 4
     *
     * */
    public static String getProcessURL_QN(Accessory accessory,int site){
        String url = getURL(accessory);
        switch (site){
            case 1:
                 url +=USER_IMAGE_SETTING;
                 break;
            case 2:
                 url+=GOODS_DETAIL_IMAGE_SETTING;
                break;
            case 3:
                 url+=GOODS_IMAGE_SETTING;
                break;
        }
        return url;
    }

}
